<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Insert title here</title>
</head>
<body>
<h3>订单列表</h3>
<input type="checkbox" value="50">鼠标50元 <br>
<input type="checkbox" value="150">键盘150元 <br>
<input type="checkbox" value="5000">华为手机5000元 <br>
<input type="checkbox" value="2500">小米电视2500元 <br>
<input type="checkbox" id="all">全选<br>
<p>合计:0元</p>

 <script type="text/javascript" src="../js/jquery-1.4.2.js"></script>
  <script type="text/javascript">
  $("input").click(function(){
	  if(this.id=="all"){
		  $(this).siblinga("input").attr("checked",this.checked);
	  }
	  var count=0;
	  var money=0;
	  $("input:not(#all)").each(function(){
		  if(this.checked){
			  count++;
			  money+=parseInt(this.value);
		  }
	  });
	  $("p").text("合计:"+money+"元");
	  $("#all").attr("checked",count==4);
  });
  </script>
</body>
</html>